package aof.biz;

import android.content.Context;

import java.util.ArrayList;

import aof.helper.MyDBHelper;
import aof.model.L_COSTTYPE;
import aof.model.M_COSTDAY;

/**
 * Created by AOF on 3/6/2556.
 */
public class L_COSTTYPE_BIZ extends MyDBHelper {

    public L_COSTTYPE_BIZ(Context context) {
        super(context);
    }

    public ArrayList<L_COSTTYPE> GetAll() {
        try {
            ArrayList<L_COSTTYPE> MyArrList = new ArrayList<L_COSTTYPE>();
            openDataBase();
            if (Query("SELECT * FROM L_COSTTYPE ORDER BY OID ")) {
                do {
                    L_COSTTYPE model = new L_COSTTYPE();
                    model.setOID(getDataInt("OID"));
                    model.setNAME_TH(getDataString("NAME_TH"));
                    model.setNAME_EN(getDataString("NAME_EN"));
                    model.setActive(getDataString("Active"));
                    model.setCreate_By(getDataString("Create_By"));
                    model.setCreate_Date(getDataString("Create_Date"));
                    model.setUpdate_By(getDataString("Update_By"));
                    model.setUpdate_Date(getDataString("Update_Date"));
                    MyArrList.add(model);
                } while (IsReadData());
            }
            return MyArrList;

        } catch (Exception e) {
            return null;
        } finally {
            closeDataBase();
        }
    }
}
